import request from "@/utils/request";

// 查询旅游路线列表
export function listTravelRoute(query) {
  return request({
    url: "/route/travelRoute/list",
    method: "get",
    params: query,
  });
}

// 查询旅游路线详细
export function getTravelRoute(id) {
  return request({
    url: "/route/travelRoute/info",
    method: "get",
    params: { id: id },
  });
}

// 新增旅游路线
export function addTravelRoute(data) {
  return request({
    url: "/route/travelRoute",
    method: "post",
    data: data,
  });
}

// 修改旅游路线
export function updateTravelRoute(data) {
  return request({
    url: "/route/travelRoute",
    method: "put",
    data: data,
  });
}

// 修改旅游路线是否推荐
export function updateTravelRecommend(data) {
  return request({
    url: "/route/travelRoute/editIsRecommend",
    method: "get",
    params: data,
  });
}

// 删除旅游路线
export function delTravelRoute(id) {
  return request({
    url: "/route/travelRoute/" + id,
    method: "delete",
  });
}

// 导出旅游路线
export function exportTravelRoute(query) {
  return request({
    url: "/route/travelRoute/export",
    method: "get",
    params: query,
  });
}

// 获取所有乡村数据
export function townShipList(query) {
  return request({
    url: "/route/travelRoute/getAllVillage",
    method: "get",
    params: query,
  });
}

// 获取输入乡村名的乡村数据
export function townNameList(name) {
  console.log('name',name);
  return request({
    url: "/shop/goodsClassify/getAllVillage",
    method: "get",
    params: name,
  });
}


